import React from "react";
import classes from './AnswersList.css'
import  AnswerItem from './AnswerItem/AnswerItem'

const AnswersList  = (props) => (
    <ul className={classes.AnswersList}>
        { props.answers.map((answer, index) => {
            return (
                <AnswerItem 
                    key = {index}
                    answer = {answer}
                    onAnswerClick = {props.onAnswerClick}
                    stand = {props.stand ? props.stand[answer.id] : null}
                />
            )
        }) }
    </ul>
)

export default AnswersList